﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Dal;
using Watchdog.Bll;
using Watchdog.Bll.Base;

namespace Watchdog.Bll.Factory {

    public partial class ScheduleFactory {
        public static void Delete ( ScheduleBase schedule ) {
            DataClient.Current.ScheduleDelete ( schedule.IntData );
        }

        public static Schedule GetById ( int id ) {
            return new Schedule (DataClient.Current.ScheduleGetById (id));
        }
				
        public static List<Schedule> GetByTest ( int test ) {
		    List<Schedule> outlist = new List<Schedule> ();
            Watchdog.Facade.Schedule[] list = Dal.DataClient.Current.ScheduleGetByTest ( test );
            foreach (Watchdog.Facade.Schedule item in list)
                outlist.Add (new Schedule (item));
            return outlist;
            // return DataClient.Current.ScheduleGetByTest ( test );
        }
        public static void Insert ( ScheduleBase schedule ) {
            schedule.IntData = DataClient.Current.ScheduleInsert ( schedule.IntData );
        }
		
        public static void Update ( ScheduleBase schedule ) {
            DataClient.Current.ScheduleUpdate ( schedule.IntData );
        }
		
	}
}
